package com.dg11185.nearshop.net.response;

import org.json.JSONException;
import org.json.JSONObject;

public class GetMerchantStatsResponse {

    public NetStatus status = null;

    public String totalLikes = "";

    public String totalComments = "";

    public String totalFavors = "";

    public void parseJson(String response) {
        System.out.println(response);
        try {
            JSONObject jsonObject = new JSONObject(response);
            status = NetStatus.getStatus(jsonObject.optString("status"));

            if (!jsonObject.isNull("merchantStats")) {
                JSONObject statsObject = jsonObject.optJSONObject("merchantStats");
                totalLikes = statsObject.optString("totalLikes");
                totalComments = statsObject.optString("totalComments");
                totalFavors = statsObject.optString("totalFavors");
            }
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
